Skip to content

Introduce StashCollection.Apply and Pop #1068

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 10, 2015
Merged

Conversation

Therzok
Copy link
Member

@Therzok Therzok commented Jun 3, 2015

Supersedes #871

@Therzok
Copy link
Member Author

Therzok commented Jun 3, 2015

cc @nulltoken

ReinstateIndex = (1 << 0),
}
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The E_TOOMANYNEWLINES police has been alerted 🚎

@nulltoken
Copy link
Member

Although AppVeyor and Travis both disagree with me, I ❤️ this very much!!

Very neat PR, Sir!

@Therzok
Copy link
Member Author

Therzok commented Jun 3, 2015

Test coverage could be better, I agree, but nothing much I can do about that atm. CI failed because they http 503'd while getting nugets.

@nulltoken
Copy link
Member

CI failed because they http 503'd while getting nugets

AppVeyor cringes with the following

LibGit2Sharp.Tests.StashFixture.CanStashAndPop [FAIL]
   Assert.Equal() Failure
   Position: First difference is at position 10
   Expected: I'm staged

   Actual:   I'm staged
   Stack Trace:
      c:\projects\libgit2sharp\LibGit2Sharp.Tests\StashFixture.cs(259,0): at LibGit2Sharp.Tests.StashFixture.CanStashAndPop()

LibGit2Sharp.Tests.MetaFixture.TypesInLibGit2SharpMustBeExtensibleInATestingContext [FAIL]

   'LibGit2Sharp.StashCollection' cannot be easily abstracted in a testing context. Please make sure it either has a public constructor, or an empty protected constructor.
       - Method 'LibGit2Sharp.StashApplyStatus Apply(Int32)' must be virtual
   Stack Trace:
      c:\projects\libgit2sharp\LibGit2Sharp.Tests\MetaFixture.cs(112,0): at LibGit2Sharp.Tests.MetaFixture.TypesInLibGit2SharpMustBeExtensibleInATestingContext()

@Therzok
Copy link
Member Author

Therzok commented Jun 3, 2015

@nulltoken was thinking of making a common function for both Apply and Pop, so it basically is like StashApplyStatus Common(int index, StashApplyOptions options, Func<RepositorySafeHandle, int, GitStashApplyOpts, StashApplyStatus) and we call as:

Common(index, options, Proxy.git_stash_apply) and Common(index, options, Proxy.git_stash_pop from the functions and do the common code in there. Or a delegate with that prototype. Solves us the mess of maintaining two pieces of code. 🍡

@Therzok Therzok force-pushed the therzok/stashApplication branch from 5f3375a to 74ea40b Compare June 3, 2015 23:08
@nulltoken
Copy link
Member

Solves us the mess of maintaining two pieces of code.

👍

@Therzok Therzok force-pushed the therzok/stashApplication branch from 74ea40b to 9df9cda Compare June 5, 2015 21:09
@Therzok
Copy link
Member Author

Therzok commented Jun 5, 2015

Done!

@Therzok Therzok force-pushed the therzok/stashApplication branch 3 times, most recently from a2edebb to 9ec319d Compare June 5, 2015 21:40
/// <summary>
/// Default. Reinstate working directory stashed changes.
/// </summary>
Default = 0,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about making it explicit? eg. ReinstateWorkingDirectory

@Therzok Therzok force-pushed the therzok/stashApplication branch from 9ec319d to 878e094 Compare June 10, 2015 12:21
@Therzok
Copy link
Member Author

Therzok commented Jun 10, 2015

@nulltoken done.

nulltoken added a commit that referenced this pull request Jun 10, 2015
Introduce StashCollection.Apply and Pop
@nulltoken nulltoken merged commit 083361d into vNext Jun 10, 2015
@nulltoken nulltoken deleted the therzok/stashApplication branch June 10, 2015 14:00
@nulltoken nulltoken added this to the v0.22 milestone Jun 10, 2015
@nulltoken
Copy link
Member

💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants